package com.boge.study.design_pattern.observer.jdk;

import lombok.Data;

import java.util.Observable;
import java.util.Observer;

@Data
public class ConcreteObserver implements Observer {

	String observerName;

	private String remindThing;

	/**
	 *
	 * @param o 目标对象，采用拉模型的方式
	 * @param arg 推送的内容，推模型方式
	 */
	@Override
	public void update(Observable o, Object arg) {
		System.out.println(observerName + "收到了" + ((ConcreteWeatherSubject)o).getContent() + "," + remindThing);
	}

}
